﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemplateEdit.aspx.cs" Inherits="PPAP.Web.Master.TemplateEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script language="javascript">
        function del(id) {
            if (id > 0) {
                if (confirm('Please confirm to delete the file.')) {
                    url = "TemplateEdit.aspx?deid=" + id + "&DID=<%=DID %>";
                    window.location.href = url;
                }
            }
        }
    </script>
</head>
<body style="font-family: Arial, Helvetica, sans-serif; overflow-x: hidden;">
    <form id="form1" runat="server">
    <div>
        <table width="100%" style="padding-left: 10px; font-weight: bold; color: #2E8AC5;">
            <tr>
                <td width="25%">
                    Attachment type
                </td>
                <td width="75%" colspan="3">
                    <asp:TextBox autocomplete="off"   ID="txtAttachment" runat="server" Width="250px"></asp:TextBox><font
                        color='red'>*(please input attachment type)</font>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td colspan="3">
                    <asp:CheckBox ID="cbLevel1" runat="server" Text="Level1" />
                    <asp:CheckBox ID="cbLevel2" runat="server" Text="Level2" />
                    <asp:CheckBox ID="cbLevel3" runat="server" Text="Level3" />
                </td>
            </tr>
            <tr>
                <td width="25%">
                    BDNT template available
                </td>
                <td width="25%">
                    <asp:DropDownList ID="ddlTemplateAvailable" runat="server" Width="50px">
                        <asp:ListItem Value="1">Yes</asp:ListItem>
                        <asp:ListItem Value="0">No</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td width="30%">
                    Suppliers' template accepted
                </td>
                <td width="20%">
                    <asp:DropDownList ID="ddlTemplateAccepted" runat="server" Width="50px">
                        <asp:ListItem Value="1">Yes</asp:ListItem>
                        <asp:ListItem Value="0">No</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Effective
                </td>
                <td>
                    <asp:DropDownList ID="ddlIsEffective" runat="server" Width="50px">
                        <asp:ListItem Value="1">Yes</asp:ListItem>
                        <asp:ListItem Value="0">No</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    Sequence
                </td>
                <td>
                    <asp:DropDownList ID="ddlSequence" runat="server" Width="50px">
                    </asp:DropDownList>
                </td>
            </tr>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td colspan="2">
                    <font color='red'>*Sequence must be continuous, and may not be repeated.</font>
                </td>
            </tr>
            <tr>
                <td>
                    Remark
                </td>
                <td colspan="3">
                    <asp:TextBox autocomplete="off"   ID="txtRemark" runat="server" Height="90px"  TextMode="MultiLine"  style="word-wrap : break-word;word-break: break-all; overflow:hidden; " Width="500px"></asp:TextBox>
                </td>
            </tr>
            <tr style="display: none;">
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td align="right">
                    <asp:Label ID="lblUp" runat="server" Visible="False"></asp:Label>
                </td>
            </tr>
            <tr runat="server" id="trTemplate">
                <td>
                    Template
                </td>
                <td colspan="3">
                    <asp:FileUpload ID="file" runat="server" Width="430px" />
                    <asp:Button ID="btnUpload" runat="server" CssClass="button" OnClick="btnUpload_Click"
                        Text="Upload" />
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <asp:GridView ID="GridView2" runat="server" CellPadding="4" Width="100%" ForeColor="#333333"
                        GridLines="None" AutoGenerateColumns="False">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField HeaderText="No." ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("rownum") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Title" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%#Eval("F_Filename") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Type" Visible="false" ItemStyle-HorizontalAlign="Left"
                                HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='pdf'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Size" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="Label7" runat="server" Text='<%# Eval("filesize") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Create date" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="Label8" runat="server" Text='<%# Eval("UpTime") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Link" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <a href='<%#Eval("F_URL") %>' target="_blank"><span style="color: Blue;">
                                        <%# Eval("F_Filename")%></span></a>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Delete" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" Visible='<%#Eval("F_ID").ToString()==""?false:false %>'
                                        runat="server" OnClientClick="return confirm('Please confirm to delete the file.')"
                                        PostBackUrl='<%# "Template.aspx?deid="+Eval("F_ID")%>'>Delete</asp:LinkButton>
                                    <img src="../Images/newimg/delete.png" title="Delete" onclick="<%#"javascript:del("+Eval("F_ID")+")" %>" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#2E8AC5" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" ForeColor="#000000" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Left" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td colspan="4" align="center">
                    <asp:Button ID="Button1" CssClass="button" runat="server" Text="Add" OnClick="Button1_Click"
                        OnClientClick="return confirm('Are you sure you want to save?');" />
                </td>
        </table>
    </div>
    </form>
</body>
</html>
